import request from '@/utils/request'

// 获取权限
export function getPermissionList(params) {
  return request({
    url: '/sys/permission',
    params
  })
}
// 新增权限
export function addPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 更新权限
export function updatePermission({
  enVisible,
  name,
  code,
  description,
  type,
  pid,
  id
}) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'put',
    data: {
      enVisible,
      name,
      code,
      description,
      type,
      pid,
      id
    }
  })
}

// 删除权限
export function delPermission(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}
// 获取权限详情
export function getPermissionDetail(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}
